#include "stdafx.h"
#include "CommandDef.h"
#include "debug_new.h"
#include "Util/UtilInclude.h"
#include "CMSGInforCon.h"
#include "MainMenuPainter.h"

CMSGInforCon::CMSGInforCon(HWND hWnd):CMessageBoxCon(hWnd)
{
	m_fZoom=1.0;
	m_bmRePlayerMask=NULL;
}

CMSGInforCon::~CMSGInforCon(void)
{
	DeleteObject(m_bmRePlayerMask);
}

BOOL CMSGInforCon::InitControls(DWORD dwData)
{
	//message box
	LANGUAGE_DECLARE;
	FONT_DECLARE;

	HBITMAP hBitmap = NULL;
	switch(dwData)
	{
	case 1:
		{
			CResConfig ResCon;
			if(!ResCon.Init(L"MSGCustomWork.xml"))
			{
				//g_App.ShowMsgBox(CMD_MSGBOX_OK,L"",LAN_GETTEXT(Msg_ResError));
				return FALSE;
			}

			m_nAniType  = ResCon.GetAniType();
			m_nExitAniType=ResCon.GetExitAniType();
			m_nAniSpeed = ResCon.GetAniSpeed();
           SetRect(ResCon.GetRect());
			BOOL bFromDll = ResCon.IsResFromDll();
			BtnParam btnInfo;

			hBitmap = CUtil::LoadBitmapEx(ResCon.GetImage(),bFromDll);
			this->SetMaskBmp(hBitmap);

			BatTimePicParam picInfo;
			ResCon.GetBatTimePicParam(picInfo,L"Pic_Bkgnd");
			CPicture *pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC, L"OK",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			TextParam txtInfo;
			ResCon.GetTextParam(txtInfo,L"Text_Msg");
			CText *pText = (CText*)AddControl(new CText(SWS_STATIC,m_strContent.c_str(),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);
			if(m_strCaption.size()>0)
			{
				ResCon.GetTextParam(txtInfo,L"Title");
				pText = (CText*)AddControl(new CText(SWS_STATIC,m_strCaption.c_str(),txtInfo.m_rc, CMD_MSGBOX_TEXT));
				ResCon.SetTextParam(pText,txtInfo);
			}
			CBmpBtn* pBtn = NULL;
			ResCon.GetBtnParam(btnInfo,L"Btn_Yes");
			pBtn = (CBmpBtn*)AddControl(new CBmpBtn(SBS_RECT,LAN_GETTEXT(MSG_OK),btnInfo.m_rc, CMD_MSGBOX_YES));
			ResCon.SetBtnParam(pBtn,btnInfo);

			ResCon.GetBtnParam(btnInfo,L"Btn_No");
			pBtn = (CBmpBtn*)AddControl(new CBmpBtn(SBS_RECT,LAN_GETTEXT(MSG_CANCLE),btnInfo.m_rc, CMD_MSGBOX_HSNO));
			ResCon.SetBtnParam(pBtn,btnInfo);


			ResCon.GetBatTimePicParam(picInfo,L"CWIcon_BackExtention");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			ResCon.GetBatTimePicParam(picInfo,L"CWIcon_BicepsCurl");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			ResCon.GetBatTimePicParam(picInfo,L"CWIcon_TricepsKcikback");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			ResCon.GetBatTimePicParam(picInfo,L"CWIcon_ShoulderHilo");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			ResCon.GetBatTimePicParam(picInfo,L"CWIcon_SeatedRow");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			ResCon.GetBatTimePicParam(picInfo,L"CWIcon_CableKayak");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			ResCon.GetBatTimePicParam(picInfo,L"CWIcon_ChestPress");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			ResCon.GetBatTimePicParam(picInfo,L"CWIcon_PecFly");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			ResCon.GetBatTimePicParam(picInfo,L"CWIcon_TricepsExtention");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			ResCon.GetBatTimePicParam(picInfo,L"CWIcon_AbCrunch");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			ResCon.GetBatTimePicParam(picInfo,L"CWIcon_PullOver");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			ResCon.GetBatTimePicParam(picInfo,L"CWIcon_Boxing");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);


			ResCon.GetTextParam(txtInfo,L"CText_BackExtention");
			pText = (CText*)AddControl(new CText(SWS_STATICTEXT,LAN_GETTEXT(MSG_HS_CUSTOM_BACKEXTENRT),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);

			ResCon.GetTextParam(txtInfo,L"CText_BicepsCurl");
			pText = (CText*)AddControl(new CText(SWS_STATICTEXT,LAN_GETTEXT(MSG_HS_CUSTOM_BICEPSCURL),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);


			ResCon.GetTextParam(txtInfo,L"CText_TricepsKcikback");
			pText = (CText*)AddControl(new CText(SWS_STATIC,LAN_GETTEXT(MSG_HS_CUSTOM_TRICEPS),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);


			ResCon.GetTextParam(txtInfo,L"CText_ShoulderHilo");
			pText = (CText*)AddControl(new CText(SWS_STATIC,LAN_GETTEXT(MSG_HS_CUSTOM_SHOULDERHILO),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);


			ResCon.GetTextParam(txtInfo,L"CText_SeatedRow");
			pText = (CText*)AddControl(new CText(SWS_STATIC,LAN_GETTEXT(MSG_HS_CUSTOM_SEATED),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);


			ResCon.GetTextParam(txtInfo,L"CText_CableKayak");
			pText = (CText*)AddControl(new CText(SWS_STATIC,LAN_GETTEXT(MSG_HS_CUSTOM_CABLEKAYAK),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);


			ResCon.GetTextParam(txtInfo,L"CText_ChestPress");
			pText = (CText*)AddControl(new CText(SWS_STATIC,LAN_GETTEXT(MSG_HS_CUSTOM_CHESTPRESS),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);

			ResCon.GetTextParam(txtInfo,L"CText_PecFly");
			pText = (CText*)AddControl(new CText(SWS_STATIC,LAN_GETTEXT(MSG_HS_CUSTOM_PECFLY),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);


			ResCon.GetTextParam(txtInfo,L"CText_TricepsExtention");
			pText = (CText*)AddControl(new CText(SWS_STATIC,LAN_GETTEXT(MSG_HS_CUSTOM_TRICEPSEXT),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);





			ResCon.GetTextParam(txtInfo,L"CText_PullOver");
			pText = (CText*)AddControl(new CText(SWS_STATIC,LAN_GETTEXT(MSG_HS_CUSTOM_PULLOVER),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);

			ResCon.GetTextParam(txtInfo,L"CText_AbCrunch");
			pText = (CText*)AddControl(new CText(SWS_STATIC,LAN_GETTEXT(MSG_HS_CUSTOM_ABCRUNCH),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);

			ResCon.GetTextParam(txtInfo,L"CText_Boxing");
			pText = (CText*)AddControl(new CText(SWS_STATIC,LAN_GETTEXT(MSG_HS_CUSTOM_BOXING),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);


		}
		break;

	case 2:
		{
			CResConfig ResCon;
			if(!ResCon.Init(L"MSGRound.xml"))
			{
				//g_App.ShowMsgBox(CMD_MSGBOX_OK,L"",LAN_GETTEXT(Msg_ResError));
				return FALSE;
			}

			m_nAniType  = ResCon.GetAniType();
			m_nAniSpeed = ResCon.GetAniSpeed();
           m_nExitAniType=ResCon.GetExitAniType();
			BOOL bFromDll = ResCon.IsResFromDll();
			BtnParam btnInfo;
             SetRect(ResCon.GetRect());
			hBitmap = CUtil::LoadBitmapEx(ResCon.GetImage(),bFromDll);
			this->SetMaskBmp(hBitmap);

			BatTimePicParam picInfo;
			ResCon.GetBatTimePicParam(picInfo,L"Pic_Bkgnd");
			CPicture *pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC, L"OK",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			TextParam txtInfo;
			ResCon.GetTextParam(txtInfo,L"Text_Msg");
			CText *pText = (CText*)AddControl(new CText(SWS_STATIC,m_strContent.c_str(),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);
			if(m_strCaption.size()>0)
			{
				ResCon.GetTextParam(txtInfo,L"Title");
				pText = (CText*)AddControl(new CText(SWS_STATIC,m_strCaption.c_str(),txtInfo.m_rc, CMD_MSGBOX_TEXT));
				ResCon.SetTextParam(pText,txtInfo);
			}
			CBmpBtn* pBtn = NULL;
			ResCon.GetBtnParam(btnInfo,L"Btn_Yes");
			pBtn = (CBmpBtn*)AddControl(new CBmpBtn(SBS_RECT,LAN_GETTEXT(MSG_OK),btnInfo.m_rc, CMD_MSGBOX_YES));
			ResCon.SetBtnParam(pBtn,btnInfo);

			ResCon.GetBtnParam(btnInfo,L"Btn_No");
			pBtn = (CBmpBtn*)AddControl(new CBmpBtn(SBS_RECT,LAN_GETTEXT(MSG_CANCLE),btnInfo.m_rc, CMD_MSGBOX_HSNO));
			ResCon.SetBtnParam(pBtn,btnInfo);


			ResCon.GetBatTimePicParam(picInfo,L"RDIcon_LEFT");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			ResCon.GetBatTimePicParam(picInfo,L"RDIcon_BLOCK");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			ResCon.GetBatTimePicParam(picInfo,L"RDIcon_RIGHT");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);




			ResCon.GetTextParam(txtInfo,L"CText_LEFT");
			pText = (CText*)AddControl(new CText(SWS_STATIC,LAN_GETTEXT(MSG_HS_ROUND_LEFT),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);

			ResCon.GetTextParam(txtInfo,L"CText_BLOCK");
			pText = (CText*)AddControl(new CText(SWS_STATIC,LAN_GETTEXT(MSG_HS_ROUND_BLOCK),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);


			ResCon.GetTextParam(txtInfo,L"CText_RIGHT");
			pText = (CText*)AddControl(new CText(SWS_STATIC,LAN_GETTEXT(MSG_HS_ROUND_RINGHT),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);




		}
		break;
	case 3:
		{
			CResConfig ResCon;
			if(!ResCon.Init(L"MSGFront.xml"))
			{
				//g_App.ShowMsgBox(CMD_MSGBOX_OK,L"",LAN_GETTEXT(Msg_ResError));
				return FALSE;
			}

			m_nAniType  = ResCon.GetAniType();
			m_nAniSpeed = ResCon.GetAniSpeed();
			m_nExitAniType=ResCon.GetExitAniType();
             SetRect(ResCon.GetRect());
			BOOL bFromDll = ResCon.IsResFromDll();
			BtnParam btnInfo;

			hBitmap = CUtil::LoadBitmapEx(ResCon.GetImage(),bFromDll);
			this->SetMaskBmp(hBitmap);

			BatTimePicParam picInfo;
			ResCon.GetBatTimePicParam(picInfo,L"Pic_Bkgnd");
			CPicture *pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC, L"OK",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			TextParam txtInfo;
			ResCon.GetTextParam(txtInfo,L"Text_Msg");
			CText *pText = (CText*)AddControl(new CText(SWS_STATIC,m_strContent.c_str(),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);
			if(m_strCaption.size()>0)
			{
				ResCon.GetTextParam(txtInfo,L"Title");
				pText = (CText*)AddControl(new CText(SWS_STATIC,m_strCaption.c_str(),txtInfo.m_rc, CMD_MSGBOX_TEXT));
				ResCon.SetTextParam(pText,txtInfo);
			}
			CBmpBtn* pBtn = NULL;
			ResCon.GetBtnParam(btnInfo,L"Btn_Yes");
			pBtn = (CBmpBtn*)AddControl(new CBmpBtn(SBS_RECT,LAN_GETTEXT(MSG_OK),btnInfo.m_rc, CMD_MSGBOX_YES));
			ResCon.SetBtnParam(pBtn,btnInfo);

			ResCon.GetBtnParam(btnInfo,L"Btn_No");
			pBtn = (CBmpBtn*)AddControl(new CBmpBtn(SBS_RECT,LAN_GETTEXT(MSG_CANCLE),btnInfo.m_rc, CMD_MSGBOX_HSNO));
			ResCon.SetBtnParam(pBtn,btnInfo);


			ResCon.GetBatTimePicParam(picInfo,L"Front_BackExtention");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			ResCon.GetBatTimePicParam(picInfo,L"Front_BicepsCurl");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			ResCon.GetBatTimePicParam(picInfo,L"Front_TricepsKcikback");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			ResCon.GetBatTimePicParam(picInfo,L"Front_ShoulderHilo");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			ResCon.GetBatTimePicParam(picInfo,L"Front_SeatedRow");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);



			ResCon.GetTextParam(txtInfo,L"CText_BackExtention");
			pText = (CText*)AddControl(new CText(SWS_STATIC,LAN_GETTEXT(MSG_HS_CUSTOM_BACKEXTENRT),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);

			ResCon.GetTextParam(txtInfo,L"CText_BicepsCurl");
			pText = (CText*)AddControl(new CText(SWS_STATIC,LAN_GETTEXT(MSG_HS_CUSTOM_BICEPSCURL),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);


			ResCon.GetTextParam(txtInfo,L"CText_TricepsKcikback");
			pText = (CText*)AddControl(new CText(SWS_STATIC,LAN_GETTEXT(MSG_HS_CUSTOM_TRICEPS),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);


			ResCon.GetTextParam(txtInfo,L"CText_ShoulderHilo");
			pText = (CText*)AddControl(new CText(SWS_STATIC,LAN_GETTEXT(MSG_HS_CUSTOM_SHOULDERHILO),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);


			ResCon.GetTextParam(txtInfo,L"CText_SeatedRow");
			pText = (CText*)AddControl(new CText(SWS_STATIC,LAN_GETTEXT(MSG_HS_CUSTOM_SEATED),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);




		}
		break;
	case 4:
		{
			CResConfig ResCon;
			if(!ResCon.Init(L"MSGback.xml"))
			{
				//g_App.ShowMsgBox(CMD_MSGBOX_OK,L"",LAN_GETTEXT(Msg_ResError));
				return FALSE;
			}

			m_nAniType  = ResCon.GetAniType();
			m_nAniSpeed = ResCon.GetAniSpeed();
			m_nExitAniType=ResCon.GetExitAniType();

			BOOL bFromDll = ResCon.IsResFromDll();
			BtnParam btnInfo;
            SetRect(ResCon.GetRect());
			hBitmap = CUtil::LoadBitmapEx(ResCon.GetImage(),bFromDll);
			this->SetMaskBmp(hBitmap);

			BatTimePicParam picInfo;
			ResCon.GetBatTimePicParam(picInfo,L"Pic_Bkgnd");
			CPicture *pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC, L"OK",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			TextParam txtInfo;
			ResCon.GetTextParam(txtInfo,L"Text_Msg");
			CText *pText = (CText*)AddControl(new CText(SWS_STATIC,m_strContent.c_str(),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);
			if(m_strCaption.size()>0)
			{
				ResCon.GetTextParam(txtInfo,L"Title");
				pText = (CText*)AddControl(new CText(SWS_STATIC,m_strCaption.c_str(),txtInfo.m_rc, CMD_MSGBOX_TEXT));
				ResCon.SetTextParam(pText,txtInfo);
			}
			CBmpBtn* pBtn = NULL;
			ResCon.GetBtnParam(btnInfo,L"Btn_Yes");
			pBtn = (CBmpBtn*)AddControl(new CBmpBtn(SBS_RECT,LAN_GETTEXT(MSG_OK),btnInfo.m_rc, CMD_MSGBOX_YES));
			ResCon.SetBtnParam(pBtn,btnInfo);

			ResCon.GetBtnParam(btnInfo,L"Btn_No");
			pBtn = (CBmpBtn*)AddControl(new CBmpBtn(SBS_RECT,LAN_GETTEXT(MSG_CANCLE),btnInfo.m_rc, CMD_MSGBOX_HSNO));
			ResCon.SetBtnParam(pBtn,btnInfo);



			ResCon.GetBatTimePicParam(picInfo,L"BACK_ChestPress");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			ResCon.GetBatTimePicParam(picInfo,L"BACK_PecFly");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			ResCon.GetBatTimePicParam(picInfo,L"BACK_TricepsExtention");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			ResCon.GetBatTimePicParam(picInfo,L"BACK_AbCrunch");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			ResCon.GetBatTimePicParam(picInfo,L"BACK_PullOver");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			ResCon.GetBatTimePicParam(picInfo,L"CWIcon_Boxing");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);





			ResCon.GetTextParam(txtInfo,L"CText_ChestPress");
			pText = (CText*)AddControl(new CText(SWS_STATIC,LAN_GETTEXT(MSG_HS_CUSTOM_CHESTPRESS),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);

			ResCon.GetTextParam(txtInfo,L"CText_PecFly");
			pText = (CText*)AddControl(new CText(SWS_STATIC,LAN_GETTEXT(MSG_HS_CUSTOM_PECFLY),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);


			ResCon.GetTextParam(txtInfo,L"CText_TricepsExtention");
			pText = (CText*)AddControl(new CText(SWS_STATIC,LAN_GETTEXT(MSG_HS_CUSTOM_TRICEPSEXT),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);





			ResCon.GetTextParam(txtInfo,L"CText_PullOver");
			pText = (CText*)AddControl(new CText(SWS_STATIC,LAN_GETTEXT(MSG_HS_CUSTOM_PULLOVER),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);

			ResCon.GetTextParam(txtInfo,L"CText_AbCrunch");
			pText = (CText*)AddControl(new CText(SWS_STATIC,LAN_GETTEXT(MSG_HS_CUSTOM_ABCRUNCH),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);




		}

		break;
	case 5:

		{
			CResConfig ResCon;
			if(!ResCon.Init(L"MSGFitStreamInfo.xml"))
			{
				//g_App.ShowMsgBox(CMD_MSGBOX_OK,L"",LAN_GETTEXT(Msg_ResError));
				return FALSE;
			}

			m_nAniType  = ResCon.GetAniType();
			m_nAniSpeed = ResCon.GetAniSpeed();
			m_nExitAniType=ResCon.GetExitAniType();
            SetRect(ResCon.GetRect());
			BOOL bFromDll = ResCon.IsResFromDll();
			BtnParam btnInfo;

			hBitmap = CUtil::LoadBitmapEx(ResCon.GetImage(),bFromDll);
			this->SetMaskBmp(hBitmap);

			BatTimePicParam picInfo;
			ResCon.GetBatTimePicParam(picInfo,L"Pic_Bkgnd");
			CPicture *pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC, L"OK",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);

			TextParam txtInfo;
			ResCon.GetTextParam(txtInfo,L"Text_Msg");
			CText *pText = (CText*)AddControl(new CText(SWS_STATIC,m_strContent.c_str(),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);
			if(m_strCaption.size()>0)
			{
				ResCon.GetTextParam(txtInfo,L"Title");
				pText = (CText*)AddControl(new CText(SWS_STATIC,m_strCaption.c_str(),txtInfo.m_rc, CMD_MSGBOX_TEXT));
				ResCon.SetTextParam(pText,txtInfo);
			}
			CBmpBtn* pBtn = NULL;
			ResCon.GetBtnParam(btnInfo,L"Btn_Yes");
			pBtn = (CBmpBtn*)AddControl(new CBmpBtn(SBS_RECT,LAN_GETTEXT(MSG_OK),btnInfo.m_rc, CMD_MSGBOX_YES));
			ResCon.SetBtnParam(pBtn,btnInfo);

			ResCon.GetBtnParam(btnInfo,L"Btn_No");
			pBtn = (CBmpBtn*)AddControl(new CBmpBtn(SBS_RECT,LAN_GETTEXT(MSG_CANCLE),btnInfo.m_rc, CMD_MSGBOX_HSNO));
			ResCon.SetBtnParam(pBtn,btnInfo);



			ResCon.GetBatTimePicParam(picInfo,L"Pic_usb");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC,L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);


			ResCon.GetTextParam(txtInfo,L"Text_usb");
			pText = (CText*)AddControl(new CText(SWS_STATIC,LAN_GETTEXT(MSG_HS_TRAINER_TIPS),txtInfo.m_rc, CMD_MSGBOX_TEXT));
			ResCon.SetTextParam(pText,txtInfo);




		}
		break;

	case 6:

		{
			CResConfig ResCon;
			if(!ResCon.Init(L"MSGTrainer.xml"))
			{
				//g_App.ShowMsgBox(CMD_MSGBOX_OK,L"",LAN_GETTEXT(Msg_ResError));
				return FALSE;
			}

			m_nAniType  = ResCon.GetAniType();
			m_nAniSpeed = ResCon.GetAniSpeed();
			m_nExitAniType=ResCon.GetExitAniType();
			SetRect(ResCon.GetRect());
			BOOL bFromDll = ResCon.IsResFromDll();
			BtnParam btnInfo;

			hBitmap = CUtil::LoadBitmapEx(ResCon.GetImage(),bFromDll);
			this->SetMaskBmp(hBitmap);
        
            m_bmRePlayerMask=CUtil::LoadBitmapEx(L"MSGTRIANER\\replay.bmp",bFromDll);
			BatTimePicParam picInfo;
			ResCon.GetBatTimePicParam(picInfo,L"Pic_Bkgnd");
			CPicture *pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC, L"",picInfo.m_rc, CMD_MSGBOX_PIC));
			ResCon.SetPicParam(pPic,picInfo);
			ResCon.GetBatTimePicParam(picInfo,L"TrainerIcon");
			pPic = (CPicture*)AddControl(new CPicture(SWS_STATIC, L"",picInfo.m_rc, CMD_MAINNEU_TRIANER));
			ResCon.SetPicParam(pPic,picInfo);

	        CBmpBtn* pBtn = NULL;
			CText *pText=NULL;
			TextParam txtInfo;
		
			if(m_strCaption.size()>0)
			{
				ResCon.GetTextParam(txtInfo,L"Title");
				pText = (CText*)AddControl(new CText(SWS_STATIC,m_strCaption.c_str(),txtInfo.m_rc, CMD_MSGBOX_TEXT));
				ResCon.SetTextParam(pText,txtInfo);
			}
			

			ResCon.GetBtnParam(btnInfo,L"Btn_No");
			pBtn = (CBmpBtn*)AddControl(new CBmpBtn(SBS_RECT,LAN_GETTEXT(MSG_CANCLE),btnInfo.m_rc, CMD_MAINNEU_TRIANER_CANCEL));
			ResCon.SetBtnParam(pBtn,btnInfo);



			ResCon.GetBtnParam(btnInfo,L"Btn_Replay");
			pBtn = (CBmpBtn*)AddControl(new CBmpBtn(SBS_RECT,L"",btnInfo.m_rc, CMD_MAINNEU_TRIANER_REPLY));
			ResCon.SetBtnParam(pBtn,btnInfo);
            pBtn->Show(FALSE);
		





		}

		break;
}


   SetPainter(new CMainMenuPainter());
	return true;
	}

void CMSGInforCon::PaintMask(CDC*pDC)
	{
        CPicture *pic=  (CPicture *)ControlFromID(CMD_MAINNEU_TRIANER);
		CRect  rc=pic->GetRect();

		
		if(m_bmRePlayerMask)
		{
			pDC->SelectBitmap(GetBackGnd());
#ifndef UNDER_CE

			pDC->AlphaBlendEx(rc,m_bmRePlayerMask,rc,110);
#else
			pDC->AlphaBlendEx(rc,m_bmRePlayerMask,rc,160);
#endif

		}
		else
		{
			pDC->FillSolidRect(rc,GetBackColor());
		}


	}